@extends('store::layout')
@push('styles')
    <link href="{{asset(config('store.theme.theme2').'/vendor/bootstrap/dataTables.bootstrap4.min.css')}}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
    <div class="row">
        <div class="col-12">
            @component('store::component.table.table_tpl')
                @slot('page_title'){{$page_title}}@endslot
                @slot('tool_l_btn')
                        @component('store::component.form.button')
                            @slot('title') 申请提现 @endslot
                            @slot('elem') a @endslot
                            @slot('size') md @endslot
                            @slot('color') info @endslot
                            @slot('icon') hcl-caiwu1 @endslot
                            @slot('href') {{route('Store_Finance_wdApply')}} @endslot
                        @endcomponent
                @endslot
                @if($list->isNotEmpty())
                    @slot('table')
                        <table class="list table table-bordered table-striped">
                            <thead><tr role="row">
                                <td>
                                    @component('store::component.checkbox')
                                        @slot('name') ids-all @endslot
                                    @endcomponent
                                </td>
                                <th>订单号</th><th>提现金额</th>
                               <th>账户</th><th>申请状态</th><th>时间</th>
                                <th>备注</th><th>操作</th>
                            </tr></thead>
                            <tbody>
                            @foreach($list as $item)
                                <tr role="row" class="odd">
                                    <td>
                                        @component('store::component.checkbox')
                                            @slot('name') order_id[] @endslot
                                            @slot('class') id @endslot
                                            @slot('value') {{$item->order_id}} @endslot
                                        @endcomponent
                                    </td>
                                    <td>{{$item->wd_sn}}</td>
                                    <td>
                                        金额:{{$item->money}}<br/>
                                        手续费:{{$item->service_fee ??0}}
                                    </td>
                                    <td>
                                        收款<br/>
                                        <div class="px-3">{!! format_json($item->to_account) !!}</div>
                                    </td>
                                    <td>{{trans('store::wd.wd_status_'.$item->status)}}</td>
                                    <td>
                                        申请时间:{{$item->created_at}}
                                        @if($item->status!=0)
                                            处理时间:{{$item->handled_at}}
                                        @endif
                                    </td>
                                    <td>
                                        申请备注:{{$item->apply_remark ?? '无'}}<br/>
                                        @if($item->status!=0)
                                            处理意见:{{$item->handle_remark ?? '无'}}
                                        @endif
                                    </td>
                                    <td>
                                        @if($item->status==0)
                                            @component('store::component.form.button')
                                                @slot('title') 关闭申请 @endslot
                                                @slot('size') md @endslot
                                                @slot('color') danger @endslot
                                                @slot('icon') hcl-status-error @endslot
                                                @slot('class') btn-ajax @endslot
                                                @slot('params') {"url":"{{route('Store_Finance_wdClose',['wd_id'=>$item->id])}}","confirm":true} @endslot
                                            @endcomponent
                                        @endif
                                    </td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                    @endslot
                    @slot('page')
                        {{$list->links('store::public.pagination')}}
                    @endslot
                @else
                    @slot('table')
                        @component('store::public.empty')
                            @slot('info') 暂时没有订单 @endslot
                        @endcomponent
                    @endslot
                @endif
            @endcomponent
        </div> <!-- end col -->
    </div>
@endsection

@push('scripts')
    <script src="{{asset(config('store.plugin').'/layui/check-all.js')}}"></script>
@endpush